1. Field of the Invention
This invention relates to an image data compressing apparatus for compressing image data by an adaptive discrete cosine transform coding system used for compressing a continuous-tone image such as a grayscale image or a color image, and to an image data reconstructing apparatus for reconstructing image data from codes obtained by the adaptive discrete cosine transform system.
2. Description of the Related Art
An adaptive discrete cosine transform coding system (hereafter referred to as an ADCT system) utilizing a two-dimensional orthogonal transform is widely used as a coding system for compressing a volume of data without damaging the integrity of a continuous-tone image such as a grayscale image or a color image.
An ADCT system splits a continuous-tone image into blocks each comprising a predetermined number of picture elements (e.g. 8.times.8 picture elements), obtains a matrix composed of transform coefficients (hereafter referred to as DCT coefficients) by orthogonally transforming the image data in block units, and coding in variable lengths respective elements of the matrix quantized by using the corresponding visually adaptive thresholds (described later), thereby compressing a volume of data.
FIG. 1 is a block diagram of an image data compressing apparatus using a conventional ADCT system. FIG. 2 shows an example of a block split from a continuous-tone image.
A DCT unit 11 performs a two-dimensional discrete cosine transform (hereafter abbreviated as DCT) for an inputted block and transforms it into a matrix of DCT coefficients corresponding to respective space frequency distributions having eight (8) rows and eight (8) columns (hereafter referred to as a DCT coefficient D). FIG. 3 shows an example of the DCT coefficient matrix D.
A linear quantizer 21 quantizes respective elements of the DCT coefficient matrix D. Visually adaptive thresholds are pre-determined as a result of an experiment on visual sensitivity for PG,4 respective space frequency elements. The linear quantizer 21 stores a quantization matrix V.sub.TH made up of such visually adaptive thresholds, quantizes the DCT coefficient matrix D by using a quantization threshold matrix Q.sub.TH obtained through a multiplication between respective elements of the quantization matrix V.sub.TH and an appropriate parameter, and calculates quantized coefficient matrix D.sub.QU.
Since human vision is, generally, more sensitive to lower space frequencies and less sensitive to higher space frequencies, the absolute values of the elements in the quantization matrix V.sub.TH corresponding to lower space frequencies are smaller, whereas those corresponding to higher space frequencies are larger. Therefore, in most cases, only the DC element, which is in the first row and the first column of the quantized coefficient matrix D.sub.QU, and a very few AC elements, which represent low space frequencies, are significant coefficients having non-zero values, while the majority of the AC elements are insignificant coefficients having the zero value, as shown in FIG. 5.
FIG. 6 illustrates a zig-zag scanning order. By scanning the quantized coefficient matrix D.sub.QU according to the scanning order called a zig-zag scan, the linear quantizer 21 rearranges the two-dimensionally arrayed elements of the quantized coefficient matrix D.sub.QU into one-dimensionally arrayed elements and inputs them sequentially to a coder 31. In this case, the coder 31 sequentially receives the elements of the quantized coefficient matrix D.sub.QU starting from the one corresponding to the DC element at the head end and then those corresponding to AC elements having lower space frequencies.
The coder 31 detects significant coefficients having non zero values from among the elements of the quantized coefficient matrix D.sub.QU and counts the number of insignificant coefficients, which are inputted in a series according to the above sequence, before detecting a significant coefficient, thereby converting the rearranged elements of the quantized coefficient matrix D.sub.QU into pairs each comprising a detected significant coefficient (hereafter referred to as an index) and such a counted value (hereafter referred to as a run).
By converting the elements of the quantized coefficient matrix D.sub.QU into runs and indices, the coder 31 reduces the volume of data necessary for expressing the quantized coefficient matrix D.sub.QU.
Further, the coder 31 codes the indices and the runs ordinarily according to a draft specification for standardization (JPEG-8-R8) issued by the JPEG (Joint Photographic Experts Group). After obtaining both coded indices (hereafter referred to as index codes) and coded runs (hereafter referred to as run codes), the coder 31 outputs codes corresponding to pairs of index codes and run codes.
Here, the codes corresponding to the pairs of index codes and run codes are determined by the frequencies of the occurrences of the pairs. Shorter codes are assigned to the pairs occurring more frequently and longer codes are assigned to pairs occurring less frequently. Thus, the coder 31 further reduces the volume of data necessary for expressing runs and indices by converting the pairs of index codes and run codes into Huffman codes having code lengths commensurate with the occurrence frequencies.
Also the above described draft specification for standardization defines two format types for a case outputting a code indicating a block end and a case not outputting a code indicating a block end, depending on whether or not the last inputted element of the quantized coefficient matrix D.sub.QU is an insignificant coefficient.
When the last element read out by the zig-zag scan from the quantized coefficient matrix D.sub.QU such as shown in FIG. 5 is an insignificant coefficient, the coder 31 attaches an "EOB" code indicating that the subsequent quantized coefficients are all insignificant to the tail end of codes for a block, as shown in FIG. 7A. When the last element of the quantized coefficient matrix D.sub.QU is a significant coefficient having a non-zero value "a", as shown in FIG. 8, on the other hand, the coder 31 does not output the "EOB" code, as shown in FIG. 7B.
Thus, image data for a block are DCTed, quantized and coded.
By repeating the above described processes of a DCT, quantization and coding for all blocks of a picture, image data of the picture are compressed, and the compressed image data are stored e.g. in a disk apparatus or transmitted over a transmission path.
The image data reconstructing apparatus shown in FIG. 9 reconstructs image data from compressed data e.g. composed of the above described codes.
A decoder 41 decodes sequentially inputted codes into the pairs of index codes and run codes according to a decoding table, and sequentially restores the original indices and runs according to the above described draft specification for standardization.
A dequantizer 51 multiplies the indices by the corresponding elements of the quantization threshold matrix Q.sub.TH, and outputs the products as the appropriate elements of the DCT coefficient matrix D according to the runs described above, thereby reconstructing the DCT coefficient matrix D as shown in FIG. 10. Inverse DCT unit 731 reconstructs image data in respective blocks by two-dimensionally inversely DCTing the corresponding dequantized DCT coefficient matrix D for each of the blocks.
Here, the conventional image data compressing apparatus described above has the linear quantizer 21 obtain the quantized coefficient matrix D.sub.QU for a block and the coder 31 sequentially code the corresponding pair of index and run upon detecting each significant coefficient among the elements of the quantized coefficient matrix D.sub.QU. Since a processor or the like executes the quantization and the coding in a series, the time required for those processes has been long and image data cannot be compressed at a high speed.
Similarly, since a conventional image data reconstructing apparatus has a processor or the like execute the decoding and the dequantization in a series, the dequantization starts only after indices and runs are sequentially produced from index codes and run codes obtained by decoding codes. Therefore, the time required for those processes has been long and image data cannot be reconstructed from compressed data at a high speed.
On the other hand, although the processes can be expedited by having hardware simply replace the linear quantizer 21 and the coder 31, the circuit must necessarily be oversized. Hardware substituting for the coder 31 must have a complex circuit configuration, because the hardware needs to convert the rearranged elements of the quantized coefficient matrix D.sub.QU into pairs each comprising an index and a run, as well as to code the pairs, in synchronization with the rearrangement of the two-dimensionally arrayed elements of the quantized coefficient matrix D.sub.QU into one-dimensionally arrayed elements. Therefore, a cumbersome procedure is anticipated during a test.
Conventionally, DCT coefficients are individually read out and compressed in an image data compression through quantization, and DCT coefficients are individually reconstructed from compressed data in an image data reconstruction through dequantization.